package com.bush.mall.order.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.order.entity.OrderOperateHistoryEntity;
import com.bush.mall.order.service.OrderOperateHistoryService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 订单操作历史记录
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("orderoperatehistory")
@Api(tags = "订单操作历史记录管理" )
public class OrderOperateHistoryController {

    @Resource(name= OrderOperateHistoryService.BEAN_ID)
    private OrderOperateHistoryService orderOperateHistoryService;

    /**
     * 分页查询订单操作历史记录列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询订单操作历史记录列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return orderOperateHistoryService.queryForPage(current,size);
    }

    /**
     * 保存订单操作历史记录表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存订单操作历史记录表单")
    @PostMapping
    public Result saveOrderOperateHistory(@RequestBody OrderOperateHistoryEntity orderOperateHistory){
        return orderOperateHistoryService.saveOrderOperateHistory(orderOperateHistory);
    }

    /**
     * 修改订单操作历史记录表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改订单操作历史记录表单")
    @PutMapping
    public Result updateOrderOperateHistory(@RequestBody OrderOperateHistoryEntity orderOperateHistory){
        return orderOperateHistoryService.updateOrderOperateHistory(orderOperateHistory);
    }

    /**
     * 通过指定id删除订单操作历史记录
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除订单操作历史记录")
    @DeleteMapping
    public Result deleteOrderOperateHistory(Long id){
        return orderOperateHistoryService.deleteOrderOperateHistory(id);
    }

}
